package com.example.cycledependency;

import org.springframework.beans.factory.config.SmartInstantiationAwareBeanPostProcessor;

public class JdkProxyBeanPostProcessor implements SmartInstantiationAwareBeanPostProcessor {
    public Object getEarlyBeanReference(Object bean, String beanName) {
        if (bean instanceof InstanceA) {
            JdkDynamicProxy jdkDynamicProxy = new JdkDynamicProxy(bean);
            return jdkDynamicProxy.getProxy();
        }
        return bean;
    }
}
